Fix unicode reading on Big Endian hosts.
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 4 Nov 2005 20:24:48 +0000 (20:24 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 4 Nov 2005 20:24:48 +0000 (20:24 +0000)
gpsbabel/cet.c

index 4b88908824e01f95a1bbbfa76d613a32b259fbf8..ff9dc0e5e6088e53eaba372f341386353cd17668 100644 (file)
@@ -345,14 +345,14 @@ cet_str_uni_to_utf8(const short *src, const int length)
        cin = (unsigned short *)src;
 
        while (i-- > 0)
-           len += cet_ucs4_to_utf8(NULL, 6, *cin++);
+           len += cet_ucs4_to_utf8(NULL, 6, le_read16(cin++));
        
        res = cout = xmalloc(len + 1);
        cin = (unsigned short *)src;
        i = length;
 
        while (i-- > 0)
-           cout += cet_ucs4_to_utf8(cout, 6, *cin++);
+           cout += cet_ucs4_to_utf8(cout, 6, le_read16(cin++));
            
        *cout = '\0';